package Dao.entity;

import Chapter01.H20211215.Subject;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class Grade implements Serializable {
    private long id;
    private String gname;

    public Grade() {
    }

    //增加
    public Grade(String gname) {
        this.gname = gname;
    }

    //删
    public Grade(long id) {
        this.id = id;
    }
    //改


    public Grade(long id, String gname) {
        this.id = id;
        this.gname = gname;
    }

    private List<Subject> subjs=new ArrayList<>(0);


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getGname() {
        return gname;
    }

    public List<Subject> getSubjs() {
        return subjs;
    }

    public void setSubjs(List<Subject> subjs) {
        this.subjs = subjs;
    }

    public void setGname(String gname) {
        this.gname = gname;
    }

    @Override
    public String toString() {
        return "年级号" + id +
                "年级名" + gname;
    }
}
